package tmproject.hlhj.fhp.tmvote.presenters

import android.content.Context
import com.example.mymvp.BasePresenter
import tmproject.hlhj.fhp.tmvote.beans.BaseBean
import tmproject.hlhj.fhp.tmvote.beans.PayBean
import tmproject.hlhj.fhp.tmvote.beans.PayWaysBean
import tmproject.hlhj.fhp.tmvote.module.PayModule
import tmproject.hlhj.fhp.tmvote.views.PayView
import java.io.File

/**
 * Created by Never Fear   on 2018\8\7 0007.
Never More....
 */
class PayPresenter: BasePresenter<PayModule, PayView>(), PayModule.OnPayListener {
    override fun onPayResult(payBean: PayBean) {
        view?.onPayResp(payBean)
    }
    fun pay(user_id:String, competitor_name:String, phone:String, profile:String, activity_id:String,
            pay_way:String?, avatar: File, context: Context){
        module.pay(user_id, competitor_name, phone, profile, activity_id, pay_way, avatar, context)
    }
    fun getPayResult(payBean: PayBean){
    }

    fun getPayways(context:Context){
        module.getPayways(context)
    }

    override fun createModule() {
        module= PayModule()
        module.listener=this
    }

    override fun onSignResult(baseBean: BaseBean) {
        view?.gotSignResp(baseBean)
    }

    override fun onPaywaysRep(payWaysBean: PayWaysBean) {
        view?.setPayWays(payWaysBean)
    }
}